package com.taotao.controller;

import com.taotao.common.pojo.TaotaoResult;
import com.taotao.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 如果索引库控制器
 */
@Controller
public class ImportAllItemsController {

    @Autowired
    private SearchService searchService;

    /**
     * 导入所有商品数据到索引库
     *
     * @return
     */
    @RequestMapping("/index/importAll")
    @ResponseBody
    public TaotaoResult importAll() throws Exception {
        return searchService.importAllSearchItems();
    }

}
